<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/Admin/lib/html5.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/respond.min.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="icon" href="/bitbug_favicon.ico" />
<link href="/Public/Admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="/Public/Admin/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="/Public/Admin/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">

<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->


<title>添加用户</title>
</head>
<body>
<div class="pd-20">
  <form action="" method="post" class="form form-horizontal" id="form-member-add">
    <div class="row cl">
    	<label class="form-label col-3">商品分类：</label>
      <div class="formControls col-5"> <span class="select-box">
        <select class="select" size="1" name="cat_id">
          <option value="0" selected>请选择分类</option>
          <?php if(is_array($cats)): $i = 0; $__LIST__ = $cats;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v['id']); ?>" <?php if($goods['cat_id'] == $v['id']): ?>selected<?php endif; ?>><?php echo str_repeat('　',$v['C_count']); echo ($v['cat_name']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
        </select>
        </span> </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>商品名称：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="<?php echo ($goods['goods_name']); ?>" placeholder="" id="member-name" name="goods_name" >
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3">商品品牌：</label>
      <div class="formControls col-5"> <span class="select-box">
        <select class="select" size="1" name="goods_brand">
          <option value="0" selected>请选择品牌</option>
          <?php if(is_array($brands)): $i = 0; $__LIST__ = $brands;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v['id']); ?>" <?php if($goods['goods_brand'] == $v['id']): ?>selected<?php endif; ?>><?php echo ($v['brand_name']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
        </select>
        </span> </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3">市场价格：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="<?php if(empty($goods)): ?>0.00<?php else: echo ($goods['market_price']); endif; ?>" placeholder="" id="member-tel" name="market_price">
      </div>
      <div class="col-4"> </div>
    </div>
     <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>本店价格：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="<?php if(empty($goods)): ?>0.00<?php else: echo ($goods['shop_price']); endif; ?>" placeholder="" id="member-tel" name="shop_price"  datatype="*" nullmsg="价格不能为空">
      </div>
      <div class="col-4"> </div>
    </div>
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>是否上架：</label>
      <div class="formControls col-5 skin-minimal">
        <div class="radio-box">
          <input type="radio" id="sex-1" name="is_on_sale" value="1" <?php if(empty($goods)): ?>checked<?php endif; ?> <?php if($goods['is_on_sale'] == 1): ?>checked<?php endif; ?>>
          <label for="sex-1">是</label>
        </div>
        <div class="radio-box">
          <input type="radio" id="sex-2" name="is_on_sale" value="0" <?php if($goods['is_on_sale'] == 0 && isset($goods)): ?>checked<?php endif; ?>>
          <label for="sex-2">否</label>
        </div>
      </div>
      <div class="col-4"> </div>
    </div>
    
   	<div class="row cl">
      <label class="form-label col-3">商品库存：</label>
      <div class="formControls col-5">
        <input type="text" class="input-text" value="<?php echo ($goods['goods_count']); ?>" placeholder="" id="member-tel" name="goods_count">
      </div>
      <div class="col-4"> </div>
    </div>
    	<div class="row cl">
		<label class="form-label col-3">商品描述：</label>
		<div class="formControls col-5"> 
			<textarea class="textarea" name="goods_desc"><?php echo ($goods['goods_desc']); ?></textarea>
		</div>
	</div>
   	<div class="row cl">
		<label class="form-label col-3">商品介绍：</label>
		<div class="formControls col-8"> 
			<script name="goods_into" id="editor" type="text/plain" style="width:100%;height:400px;"><?php echo (htmlspecialchars_decode($goods['goods_into'])); ?></script> 
		</div>
	</div>
	<?php if(!empty($goods)): ?><input type="hidden" value='<?php echo ($goods['id']); ?>' name='goods_id'/><?php endif; ?>
    <div class="row cl">
      <div class="col-9 col-offset-3">
        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
      </div>
    </div>
  </form>
</div>
</div>

<script type="text/javascript" src="/Public/Admin/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/Public/Admin/js/H-ui.js"></script> 
<script type="text/javascript" src="/Public/Admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/Public/Admin/js/jquery.form.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/ueditor/1.4.3/ueditor.config.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
<script type="text/javascript" src="/Public/Admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script> 
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-member-add").Validform({
		tiptype:2,
		ajaxPost:true,
		callback:function(data){
			$.Hidemsg();
			if(data.status == 'y'){
				layer.msg('成功',{icon:6,time:1000});
				setTimeout(function(){
					var index = parent.layer.getFrameIndex(window.name);
					parent.location.reload();
					parent.layer.close(index);
				},1000);
			}else{
				layer.msg(data.msg,{icon:5,time:1000});	
			}
		}
	});
	
	var ue = UE.getEditor('editor');
});
</script>
</body>


</html>